﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using BoekenUsb4.View;

namespace BoekenUsb4
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            //check op .NET-framework
            Microsoft.Win32.RegistryKey installed_versions = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\NET Framework Setup\NDP");
            string[] version_names = installed_versions.GetSubKeyNames();
            double framework = Convert.ToDouble(version_names[version_names.Length - 1].Remove(0, 1));
            if (framework>=35){
                Application.Run(new AfhalingCreatie(true));
            }else{
                int tiental = (int)framework / 10;
                int eenvoud = (int)framework - tiental * 10;
                MessageBox.Show("U hebt versie " + tiental+"."+eenvoud + " van het .Net Framework.\nDit programma heeft minstens versie 3.5 nodig.\nGelieve deze te installeren.", "Foute versie .Net Famework");
            }
        }
    }
}
